package ${serviceImplUrl};

import ${entityUrl}.${entityName};
import ${daoUrl}.${entityName}Dao;
import ${serviceUrl}.${entityName}Service;
import ${serviceUrl}.CommonCurdService;
import ${commonUrl}.MulTableQuery;
import ${commonUrl}.CommonCurdPageBean;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.efast.cafe.framework.service.CafeServiceImpl;
import java.util.List;

/**
 * filename:${entityName}ServiceImpl ${createTime}
 * project ${project}  ${version}
 * Copyright: Copyright (c) 2019 ${author} Co. Ltd.
*
 * <p>说明： ${entityComment}服务实现层</P>
 * version: ${version}
 * @author : ${author}
 * 
 * Modification History:
 * Date         	Author          Version          Description
 *---------------------------------------------------------------*
 * ${createTime}      ${author}    ${version}           initialize
 */
@Service
public class ${entityName}ServiceImpl  extends CafeServiceImpl<${entityName}> implements ${entityName}Service  {

    private final ${entityName}Dao ${objectName}Dao;
    private final CommonCurdService commonCurdService;

    @Autowired
    public ${entityName}ServiceImpl(${entityName}Dao ${objectName}Dao,CommonCurdService commonCurdService) {
        this.${objectName}Dao = ${objectName}Dao;
        this.mapper = ${objectName}Dao;
        this.commonCurdService = commonCurdService;
    }

    @Override
    public void insertOne(${entityName} ${objectName}) {
        commonCurdService.insertOne(cqaIssueRecord);
    }

    @Override
    public void deleteById(${entityName} ${objectName}) {
        commonCurdService.deleteByEntity(cqaIssueRecord);
    }

    @Override
    public void updateById(${entityName} ${objectName}) {
        commonCurdService.updateById(cqaIssueRecord);
    }

    @Override
    public MulTableQuery.Pagination<${entityName}> queryByConditionPage(CommonCurdPageBean<${entityName}> pageBean) {
        Integer[] page = MulTableQuery.handlePageParment(pageBean);
        ${entityName} t = pageBean.getT();
        return (MulTableQuery.Pagination<${entityName}>) commonCurdService.queryAnyTableByConditionPage(t, page[0], page[1]);
    }

    @Override
    public List<${entityName}> queryByCondition(${entityName} entity) {
        return (List<${entityName}>) commonCurdService.queryAnyTableByCondition(entity);
    }

    @Override
    public ${entityName} selectById(${entityName} entity) {
        return (${entityName}) commonCurdService.queryOneAnyTableByCondition(entity);
    }

}